package com.todo.strategy.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2024/4/25 20:42
 * @description
 */
@Getter
@AllArgsConstructor
public enum PlanRelationSceneEnum {

    USER_STRATEGY(1, "USER_STRATEGY", "清单计划-用户攻略"),
    PLATFORM_STRATEGY(2, "PLATFORM_STRATEGY", "平台攻略"),
    TRAVEL_CARD(3, "TRAVEL_CARD", "旅游卡"),

    ;

    private static Map<Integer, PlanRelationSceneEnum> typeMap = Arrays
            .stream(PlanRelationSceneEnum.values())
            .collect(Collectors.toMap(PlanRelationSceneEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static PlanRelationSceneEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
